home *** CD-ROM | disk | FTP | other *** search
/ MacFormat España 24 / MacFormat n. 24 (Spain) / MacFormat 24.bin / Demos / Jungle Activated! / JungleActivated Demo / jung DEMO d / 00159_Mixer- Enter Frame 2.ls < prev    next >
Encoding:
Text File  |  1996-10-14  |  7.5 KB  |  234 lines

  1. on enterFrame
  2.   global gWhichSound1, gWhichSound3, gWhichSound4, gWhichSound5, gWhichSound6, gLastLoop, gWhichSound7, gWhichSound8, gWhichSound9, gWhichSound10, gWhichSound11, gBassStop, gCounter
  3.   if voidp(gLastLoop) then
  4.     set gLastLoop to 0
  5.   end if
  6.   if voidp(gCounter) or (gCounter > 9) then
  7.     set gCounter to 1
  8.   else
  9.     set gCounter to gCounter + 1
  10.   end if
  11.   if gCounter = 2 then
  12.     set gCounter to 5
  13.   end if
  14.   if gCounter = 6 then
  15.     set gCounter to 10
  16.   end if
  17.   if gCounter <= 5 then
  18.     if gCounter < 3 then
  19.       if (gCounter = 1) and (gBassStop = 0) and (soundBusy(1) = 0) then
  20.         sound playFile 1, gWhichSound1
  21.       end if
  22.       if (gCounter = 2) and not (gWhichSound3 = EMPTY) and (soundBusy(4) = 0) then
  23.         sound playFile 4, gWhichSound3
  24.       end if
  25.     else
  26.       if (gCounter = 3) and not (gWhichSound4 = EMPTY) and (soundBusy(5) = 0) then
  27.         sound playFile 5, gWhichSound4
  28.       end if
  29.       if (gCounter = 4) and not (gWhichSound5 = EMPTY) and (soundBusy(6) = 0) then
  30.         sound playFile 6, gWhichSound5
  31.       end if
  32.       if (gCounter = 5) and not (gWhichSound6 = EMPTY) and (soundBusy(7) = 0) then
  33.         sound playFile 7, gWhichSound6
  34.       end if
  35.     end if
  36.   else
  37.     if gCounter < 8 then
  38.       if (gCounter = 6) and not (gWhichSound7 = EMPTY) and (soundBusy(8) = 0) then
  39.         sound playFile 8, gWhichSound7
  40.       end if
  41.       if (gCounter = 7) and not (gWhichSound8 = EMPTY) and (soundBusy(9) = 0) then
  42.         sound playFile 9, gWhichSound8
  43.       end if
  44.     else
  45.       if (gCounter = 8) and not (gWhichSound9 = EMPTY) and (soundBusy(10) = 0) then
  46.         sound playFile 10, gWhichSound9
  47.       end if
  48.       if (gCounter = 9) and not (gWhichSound10 = EMPTY) and (soundBusy(11) = 0) then
  49.         sound playFile 11, gWhichSound10
  50.       end if
  51.       if (gCounter = 10) and (the volume of sound 12 > 0) and (soundBusy(12) = 0) then
  52.         sound playFile 12, getpn() & "Sounds:Loops:Renkgrve.aif"
  53.       end if
  54.     end if
  55.   end if
  56. end
  57.  
  58. on exitFrame
  59.   go(the frame)
  60.   FlashingLights()
  61. end
  62.  
  63. on idle
  64.   SlidersTracker()
  65.   testSliders()
  66. end
  67.  
  68. on testSliders
  69.   global gSliderPos1, gSliderPos2, gSliderPos3, gSliderPos4, gBassScale, gLoopScale, gKeyboardScale, gOutputScale
  70.   if the mouseUp = 0 then
  71.     if the locV of sprite 3 <> gSliderPos1 then
  72.       set gSliderPos1 to the locV of sprite 3
  73.       set gBassScale to gSliderPos1
  74.       set gBassScale to (259 - gBassScale) / 0.47999999999999998
  75.       set the volume of sound 1 to gBassScale * gOutputScale / 100
  76.       set the volume of sound 2 to gBassScale * gOutputScale / 100
  77.     end if
  78.     if the locV of sprite 4 <> gSliderPos2 then
  79.       set gSliderPos2 to the locV of sprite 4
  80.       set gLoopScale to gSliderPos2
  81.       set gLoopScale to (259 - gLoopScale) / 0.47999999999999998
  82.       repeat with i = 4 to 11
  83.         set the volume of sound i to gLoopScale * gOutputScale / 100
  84.       end repeat
  85.     end if
  86.     if the locV of sprite 5 <> gSliderPos3 then
  87.       set gSliderPos3 to the locV of sprite 5
  88.       set gKeyboardScale to gSliderPos3
  89.       set gKeyboardScale to (259 - gKeyboardScale) / 0.47999999999999998
  90.       set the volume of sound 3 to gKeyboardScale * gOutputScale / 100
  91.       set the volume of sound 13 to gKeyboardScale * gOutputScale / 100
  92.       set the volume of sound 14 to gKeyboardScale * gOutputScale / 100
  93.       set the volume of sound 15 to gKeyboardScale * gOutputScale / 100
  94.     end if
  95.     if the locV of sprite 6 <> gSliderPos4 then
  96.       set gSliderPos4 to the locV of sprite 6
  97.       set gOutputScale to gSliderPos4
  98.       set gOutputScale to (276 - gOutputScale) / 1.83000000000000007
  99.       set the volume of sound 1 to gBassScale * gOutputScale / 100
  100.       set the volume of sound 2 to gBassScale * gOutputScale / 100
  101.       set the volume of sound 3 to gKeyboardScale * gOutputScale / 100
  102.       set the volume of sound 13 to gKeyboardScale * gOutputScale / 100
  103.       set the volume of sound 14 to gKeyboardScale * gOutputScale / 100
  104.       set the volume of sound 15 to gKeyboardScale * gOutputScale / 100
  105.       repeat with i = 4 to 11
  106.         set the volume of sound i to gLoopScale * gOutputScale / 100
  107.       end repeat
  108.     end if
  109.   end if
  110. end
  111.  
  112. on SlidersTracker
  113.   if the locH of sprite 3 > 182 then
  114.     set the locH of sprite 3 to 182
  115.   end if
  116.   if the locV of sprite 3 > 259 then
  117.     set the locV of sprite 3 to 259
  118.   end if
  119.   if the locH of sprite 4 > 234 then
  120.     set the locH of sprite 4 to 234
  121.   end if
  122.   if the locV of sprite 4 > 259 then
  123.     set the locV of sprite 4 to 259
  124.   end if
  125.   if the locH of sprite 5 > 286 then
  126.     set the locH of sprite 5 to 286
  127.   end if
  128.   if the locV of sprite 5 > 259 then
  129.     set the locV of sprite 5 to 259
  130.   end if
  131.   if the locH of sprite 3 < 182 then
  132.     set the locH of sprite 3 to 182
  133.   end if
  134.   if the locV of sprite 3 < 136 then
  135.     set the locV of sprite 3 to 136
  136.   end if
  137.   if the locH of sprite 4 < 234 then
  138.     set the locH of sprite 4 to 234
  139.   end if
  140.   if the locV of sprite 4 < 136 then
  141.     set the locV of sprite 4 to 136
  142.   end if
  143.   if the locH of sprite 5 < 286 then
  144.     set the locH of sprite 5 to 286
  145.   end if
  146.   if the locV of sprite 5 < 136 then
  147.     set the locV of sprite 5 to 136
  148.   end if
  149.   if the locH of sprite 6 < 461 then
  150.     set the locH of sprite 6 to 461
  151.   end if
  152.   if the locV of sprite 6 < 136 then
  153.     set the locV of sprite 6 to 136
  154.   end if
  155.   if the locH of sprite 6 > 461 then
  156.     set the locH of sprite 6 to 461
  157.   end if
  158.   if the locV of sprite 6 > 276 then
  159.     set the locV of sprite 6 to 276
  160.   end if
  161. end
  162.  
  163. on FlashingLights
  164.   global gCounter, gBassScale, gLoopScale, gKeyboardScale, gOutputScale
  165.   if the frameLabel = "Help" then
  166.     exit
  167.   end if
  168.   if the frameLabel = "Help 1" then
  169.     exit
  170.   end if
  171.   if the frameLabel = "Help 2" then
  172.     exit
  173.   end if
  174.   set OnOrOff to the number of cast "Lights"
  175.   if not (gCounter = 1) then
  176.     if the castNum of sprite 24 = (OnOrOff + 1) then
  177.       set the castNum of sprite 24 to OnOrOff + 3
  178.     else
  179.       if the castNum of sprite 24 = (OnOrOff + 2) then
  180.         set the castNum of sprite 24 to OnOrOff + 1
  181.       else
  182.         if the castNum of sprite 24 = (OnOrOff + 3) then
  183.           set the castNum of sprite 24 to OnOrOff + 0
  184.         else
  185.           set the castNum of sprite 24 to OnOrOff + 2
  186.         end if
  187.       end if
  188.     end if
  189.   end if
  190.   if not ((gCounter = 2) or (gCounter = 6)) then
  191.     if the castNum of sprite 2 = OnOrOff then
  192.       set the castNum of sprite 2 to OnOrOff + 3
  193.     else
  194.       if the castNum of sprite 2 = (OnOrOff + 3) then
  195.         set the castNum of sprite 2 to OnOrOff + 2
  196.       else
  197.         if the castNum of sprite 2 = (OnOrOff + 2) then
  198.           set the castNum of sprite 2 to OnOrOff + 1
  199.         else
  200.           set the castNum of sprite 2 to OnOrOff
  201.         end if
  202.       end if
  203.     end if
  204.   end if
  205.   if not ((gCounter = 3) or (gCounter = 6) or (gCounter = 7)) then
  206.     if the castNum of sprite 47 = OnOrOff then
  207.       set the castNum of sprite 47 to OnOrOff + 1
  208.     else
  209.       if the castNum of sprite 47 = (OnOrOff + 1) then
  210.         set the castNum of sprite 47 to OnOrOff + 2
  211.       else
  212.         if the castNum of sprite 47 = (OnOrOff + 2) then
  213.           set the castNum of sprite 47 to OnOrOff + 3
  214.         else
  215.           set the castNum of sprite 47 to OnOrOff
  216.         end if
  217.       end if
  218.     end if
  219.   end if
  220.   if the castNum of sprite 48 = OnOrOff then
  221.     set the castNum of sprite 48 to OnOrOff + 2
  222.   else
  223.     if the castNum of sprite 48 = (OnOrOff + 1) then
  224.       set the castNum of sprite 48 to OnOrOff + 3
  225.     else
  226.       if the castNum of sprite 48 = (OnOrOff + 2) then
  227.         set the castNum of sprite 48 to OnOrOff + 1
  228.       else
  229.         set the castNum of sprite 48 to OnOrOff
  230.       end if
  231.     end if
  232.   end if
  233. end
  234.